crPEGetNthParameterField

The crPEGetNthParameterField function returns information about one of the parameter fields in the specified report: that is, it returns the name of the field, the data type, and information about the value set for the field.

Declare Function crPEGetNthParameterField Lib "crwrap32.dll" Alias "crvbPEGetNthParameterField" (ByVal printJob As Integer, ByVal parameterN As Integer, ByRef ValueType As Integer, ByRef DefaultValueSet As Integer, ByRef CurrentValueSet As Integer, ByRef Name As String, ByRef Prompt As String, ByRef DefaultValue As Any, ByRef CurrentValue As Any) As Integer

Parameters

printJob

Specifies the handle of the print job that contains the parameter field about which you want to retrieve information.

parameterN

Specifies the number of the parameter field about which you want to retrieve information.

ValueType

Specifies the data type of the parameter field. The Crystal Report Engine supports the following data types: number, currency, Boolean, date, and string. Use the appropriate constant from the list below.

Data Type Constant


Number

PE_PF_NUMBER


Currency

PE_PF_CURRENCY


Boolean

PE_PF_BOOLEAN


Date

PE_PF_DATE


String

PE_PF_STRING

DefaultValueSet

Indicates whether or not a default value was set for the parameter field when the parameter field was created or modified in Crystal Reports. The value can be either TRUE (1) if the field was given a default value or FALSE (0) if it was not.

CurrentValueSet

Before PEStartPrintJob is called, this value indicated whether or not the user is prompted for a parameter field value. A value of 0 means they will be prompted; a value of 1 means they will not be prompted.

This value will contain 1 before PEStartPrintJob is called if:

the report contains saved data, or

crPESetNthParameterField has been called.

If PEStartPrintJob has been called, and the user has entered a parameter and said OK to the prompt, this parameter will equal 1 (TRUE) if the user enters a value at the prompt and 0 (FALSE) if the user clicks Cancel.

Return Value

TRUE (1) if the call is successful; FALSE (0) if the call fails.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com